package com.lingchen.boot.gof.proxy.jdk;

import java.lang.reflect.Proxy;

/**
 * Created by lc on 2020/6/28
 */
public class JdkProxyTest {

    public static void main(String[] args) {
        LandlordService landlord = new Landlord();

        LandlordService proxyInstance = (LandlordService) Proxy.newProxyInstance(landlord.getClass().getClassLoader(),
                landlord.getClass().getInterfaces(),
                new QFang(landlord));

        proxyInstance.pay("凌晨");
    }
}
